import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutterapp1/color/MyColor.dart';
class ATClassifyItem extends StatelessWidget{
  ATClassifyItem({Key key, this.title,this.subTitle,this.url,this.onTap}) : super(key: key);
  final String title;
  final String subTitle;
  final String url;
  final GestureTapCallback onTap;
  @override
  Widget build(BuildContext context) {
    var width =  (ScreenUtil.screenWidthDp - 40)/3;
    var height = width * 1.35;
    return new Container(
      color: MyColor.AppFFFFFF,
      child: GestureDetector(
        onTap: onTap,
        child: new Column(
          children: <Widget>[
            new Container(
              width: width,
              height: height,
              child: Image.network(url, fit: BoxFit.cover),
            ),
            new Container(
              margin: EdgeInsets.only(top:10),
              width: width,
              child: Text(title,maxLines: 1,textAlign: TextAlign.center,),
            ),
            new Container(
              margin: EdgeInsets.only(top:10),
              width: width,
              child: Text(subTitle,maxLines: 1,textAlign: TextAlign.center,),
            ),
          ],
        ),
      ),

    );
  }
}

class ATClassifyHeader extends StatelessWidget{
  ATClassifyHeader({Key key, this.title,this.subTitle,this.onTap}) : super(key: key);
  final String title;
  final String subTitle;
  final GestureTapCallback onTap;
  @override
  Widget build(BuildContext context) {
    return new Container(
      color: MyColor.AppFFFFFF,
      child: GestureDetector(
        onTap: onTap,
        child: new Row(
          children: <Widget>[
            Expanded(child: Text(title,maxLines: 1,textAlign: TextAlign.left,style: TextStyle(fontSize: 20,color: MyColor.App000000),),),
            Expanded(child: Text(subTitle,maxLines: 1,textAlign: TextAlign.right,))
          ],
        ),
      ),

    );
  }
}
